/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package plum.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import plum.MinMaxValuesAction;
import plum.PlumPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Min Max Values Action</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link plum.impl.MinMaxValuesActionImpl#getMinValueQuery <em>Min Value Query</em>}</li>
 *   <li>{@link plum.impl.MinMaxValuesActionImpl#getMaxValueQuery <em>Max Value Query</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MinMaxValuesActionImpl extends ActionImpl implements MinMaxValuesAction {
	/**
	 * The default value of the '{@link #getMinValueQuery() <em>Min Value Query</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinValueQuery()
	 * @generated
	 * @ordered
	 */
	protected static final String MIN_VALUE_QUERY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMinValueQuery() <em>Min Value Query</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinValueQuery()
	 * @generated
	 * @ordered
	 */
	protected String minValueQuery = MIN_VALUE_QUERY_EDEFAULT;

	/**
	 * The default value of the '{@link #getMaxValueQuery() <em>Max Value Query</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaxValueQuery()
	 * @generated
	 * @ordered
	 */
	protected static final String MAX_VALUE_QUERY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMaxValueQuery() <em>Max Value Query</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaxValueQuery()
	 * @generated
	 * @ordered
	 */
	protected String maxValueQuery = MAX_VALUE_QUERY_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected MinMaxValuesActionImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return PlumPackage.Literals.MIN_MAX_VALUES_ACTION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMinValueQuery() {
		return minValueQuery;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMinValueQuery(String newMinValueQuery) {
		String oldMinValueQuery = minValueQuery;
		minValueQuery = newMinValueQuery;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, PlumPackage.MIN_MAX_VALUES_ACTION__MIN_VALUE_QUERY, oldMinValueQuery, minValueQuery));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getMaxValueQuery() {
		return maxValueQuery;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMaxValueQuery(String newMaxValueQuery) {
		String oldMaxValueQuery = maxValueQuery;
		maxValueQuery = newMaxValueQuery;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, PlumPackage.MIN_MAX_VALUES_ACTION__MAX_VALUE_QUERY, oldMaxValueQuery, maxValueQuery));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case PlumPackage.MIN_MAX_VALUES_ACTION__MIN_VALUE_QUERY:
				return getMinValueQuery();
			case PlumPackage.MIN_MAX_VALUES_ACTION__MAX_VALUE_QUERY:
				return getMaxValueQuery();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case PlumPackage.MIN_MAX_VALUES_ACTION__MIN_VALUE_QUERY:
				setMinValueQuery((String)newValue);
				return;
			case PlumPackage.MIN_MAX_VALUES_ACTION__MAX_VALUE_QUERY:
				setMaxValueQuery((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case PlumPackage.MIN_MAX_VALUES_ACTION__MIN_VALUE_QUERY:
				setMinValueQuery(MIN_VALUE_QUERY_EDEFAULT);
				return;
			case PlumPackage.MIN_MAX_VALUES_ACTION__MAX_VALUE_QUERY:
				setMaxValueQuery(MAX_VALUE_QUERY_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case PlumPackage.MIN_MAX_VALUES_ACTION__MIN_VALUE_QUERY:
				return MIN_VALUE_QUERY_EDEFAULT == null ? minValueQuery != null : !MIN_VALUE_QUERY_EDEFAULT.equals(minValueQuery);
			case PlumPackage.MIN_MAX_VALUES_ACTION__MAX_VALUE_QUERY:
				return MAX_VALUE_QUERY_EDEFAULT == null ? maxValueQuery != null : !MAX_VALUE_QUERY_EDEFAULT.equals(maxValueQuery);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (minValueQuery: ");
		result.append(minValueQuery);
		result.append(", maxValueQuery: ");
		result.append(maxValueQuery);
		result.append(')');
		return result.toString();
	}

} //MinMaxValuesActionImpl
